Skip to content

fix: remove dead halftone code + fix docstrings + switch to from_hf()#87

Merged
AdaWorldAPI merged 1 commit into
masterfrom
claude/risc-thought-engine-TCZw7
Apr 6, 2026
Merged

fix: remove dead halftone code + fix docstrings + switch to from_hf()#87
AdaWorldAPI merged 1 commit into
masterfrom
claude/risc-thought-engine-TCZw7

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

Summary

Remove dead halftone code + fix docstrings + switch to from_hf(). -121 lines.

Removed (dead code producing wrong results if called)

  1. HALFTONE_POS + HALFTONE_TO_BIN — dead consts
  2. project_row_bf16_strided() — halftone (9/17 bins, interpolated odds). Trap: same-ish name as production project_1row_bf16_strided (all 17 bins).
  3. read_tensor_bf16_raw() — OOM on large tensors. Replaced by chunked reads.
  4. test_halftone_positions_coverage — tested dead const
  5. SCOUT_SHARD_SIZES — replaced by from_hf() exact sizes

Fixed

  1. Docstring: "9 halftone bins" → "17 bins", "171 vaddpd" → "323 vaddpd"
  2. Test: strided vs full now uses production project_1row_bf16_strided
  3. Scout + Maverick: hardcoded URL → HttpRangeReader::from_hf(repo, filename)

20 tests pass, 8 ignored (network).

https://claude.ai/code/session_019RzHP8tpJu55ESTxhfUy1A

7 fixes from code review:

REMOVED (dead code producing wrong results if called):
  1. HALFTONE_POS + HALFTONE_TO_BIN consts — only used by dead function
  2. project_row_bf16_strided() — halftone version with interpolated odd bins.
     Production uses project_1row_bf16_strided (all 17 real bins).
     Same-ish name, wrong results = trap.
  3. read_tensor_bf16_raw() — loads full tensor as Vec<u16>.
     Replaced by inline chunked reads. OOM on 10.7 GB expert tensors.
  4. test_halftone_positions_coverage — tested dead const
  5. SCOUT_SHARD_SIZES — no longer needed (from_hf gets exact sizes)

FIXED:
  6. project_tensor_bf16_simd docstring: "9 halftone bins" → "17 bins",
     "9 zmm" → "17 zmm", "171 vaddpd" → "323 vaddpd"
  7. test_strided_vs_full_agreement: compared dead project_row_bf16_strided
     → now compares project_1row_bf16_strided (production path)

FIXED (hardcoded URLs):
  8. run_llama4_shard: hardcoded URL → HttpRangeReader::from_hf(repo, filename)
  9. Maverick test: hardcoded URL → HttpRangeReader::from_hf(repo, filename)
     Gets exact CDN URLs, exact sizes, benefits from re-resolve on token expiry.

OK (production path verified correct):
  - project_8rows_bf16_simd: all 17 bins, SIMD gather, correct
  - project_1row_bf16_strided: all 17 bins, scalar fallback, correct
  - stream_index_gguf_bf16_with_header: chunked 128 MB, correct

20 tests pass, 8 ignored (network-dependent).

https://claude.ai/code/session_019RzHP8tpJu55ESTxhfUy1A
@AdaWorldAPI AdaWorldAPI merged commit 76a0a45 into master Apr 6, 2026
5 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants